package net.xiduth.game.player.dialogues;

import net.xiduth.game.WorldTile;
import net.xiduth.game.minigames.CastleWars;
import net.xiduth.game.player.Skills;
import net.xiduth.game.player.content.GlacorDungeon;
import net.xiduth.game.player.content.Magic;
import net.xiduth.game.player.controlers.DTControler;
import net.xiduth.game.player.controlers.FightCaves;
import net.xiduth.game.player.controlers.FightKiln;
import net.xiduth.game.player.controlers.PestControler;
import net.xiduth.game.player.controlers.RunespanControler;
import net.xiduth.game.player.controlers.Wilderness;
import net.xiduth.game.player.controlers.ZombieMinigame;
import net.xiduth.game.player.controlers.dung.RuneDungGame;
import net.xiduth.game.player.controlers.events.DeathEvent;
import net.xiduth.game.player.controlers.trollinvasion.TrollInvasion;

/**
 * @author Xiles
 */

public class TeleportCrystal extends Dialogue {

	@Override
	public void start() {
		if 			(player.isLocked()
				|| player.getControlerManager().getControler() instanceof RunespanControler 
				|| player.getControlerManager().getControler() instanceof PestControler || 
				player.getControlerManager().getControler() instanceof RuneDungGame || 
				player.getControlerManager().getControler() instanceof ZombieMinigame || player.getControlerManager().getControler() instanceof DTControler 
				|| player.getControlerManager().getControler() instanceof TrollInvasion || player.getControlerManager().getControler() instanceof DeathEvent
				|| player.getControlerManager().getControler() instanceof Wilderness
				)
		{ 
	player.getDialogueManager().startDialogue("You can't use this right now.");
		return;
		} else {
		stage = 1;
		sendOptionsDialogue("Teleport Options", "Teleport Storing", "Combat Training",
				"Skilling Locations", "Bossing Teleports", "Next Page");
		}
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == 1) {
			if (componentId == OPTION_1) { // location crystal
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				//player.getDialogueManager().startDialogue("SavedLocation");
				player.getDialogueManager().startDialogue("SimpleMessage", "Disabled.");
			} else if (componentId == OPTION_2) { // Combat Training
				sendOptionsDialogue("Combat Training", "Rock Crabs", "Yaks",
						"Cows", "Frost Dragons", "Dagannoths");
				stage = 3;
			} else if (componentId == OPTION_3) { // Skilling locations
				sendOptionsDialogue("Skilling Locations", "Woodcutting",
						"Thieving", "Summoning", "Hunter", "Next Page");
				stage = 4;
			} else if (componentId == OPTION_4) { // Bossing Teleports
				sendOptionsDialogue("Bossing Teleports", "King Black Dragon",
						"Queen Black Dragon", "Kalphite Queen",
						"Corporeal Beast", "Tormented Demons");
				stage = 5;
			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Teleport Options", "Minigames",
						"Slayer Areas", "PVP Areas", "Red Sandstone",
						"Living Rock Caverns");
				stage = 6;
			}

			/**
			 * Combat Training Teleports
			 */

		} else if (stage == 3) {
			if (componentId == OPTION_1) { // Rock Crabs
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2705,
						3716, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_2) { // Yaks
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2324,
						3803, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_3) { // Cows
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3251,
						3266, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_4) { // Frost Dragons
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1298,
						4510, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_5) { // Daggonaths
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2907,
						4449, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
			}

			/**
			 * Skilling Teleports
			 */

		} else if (stage == 4) {
			if (componentId == OPTION_1) { // Woodcutting
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2725,
						3491, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_2) { // Thieve
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2662,
						3303, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_3) { // Summoning
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2924,
						3441, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_4) { // Hunter
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2525,
						2915, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Skilling Locations", "Gnome Agility",
						"Mining", "Fishing", "Barbarian Outpost",
						"Abyss");
				stage = 10;
			}

			/**
			 * Skilling Page 2
			 */

		} else if (stage == 10) {
			if (componentId == OPTION_1) { // Gnome Agility
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2468,
						3437, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_2) { // Mining
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3298,
						3283, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_3) { // Fishing Area with custom
													// spots
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2599,
						3421, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_4) { // Barbarian Agility Outpost
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2552,
						3563, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_5) { // Abyss
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3039,
						4834, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler("Abyss");
			}

			/**
			 * Bossing Teleports
			 */

		} else if (stage == 5) {
			if (componentId == OPTION_1) { // King Black Dragon
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3067,
						10255, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_2) { // Queen Black Dragon
				if (player.getSkills().getLevelForXp(Skills.SUMMONING) < 60) {
					player.getPackets().sendGameMessage(
							"You need a summoning level of 60 to enter.");
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.getControlerManager().removeControlerWithoutCheck();
					return;
				}
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler(
						"QueenBlackDragonControler");
			} else if (componentId == OPTION_3) { // Kalphite Queen
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3483, 9491, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_4) { // Corp
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2966,
						4383, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			} else if (componentId == OPTION_5) { // Tormented Demons
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2562,
						5739, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			}

			/**
			 * Godwars Dungeon Teleport
			 */

		} else if (stage == 6) {
			if (componentId == OPTION_1) {
				sendOptionsDialogue("Minigames", "Godwars Dungeon",
						"Warriors Guild", "Barrows", "Dominion Tower",
						"Next Page");
				stage = 7;

				/**
				 * Slayer Teleports
				 */

			} else if (componentId == OPTION_2) {
				sendOptionsDialogue("Slayer Areas", "Slayer Tower",
						"Ganodermic Beasts", "Glacors", "Jadinkos", "Strykewyrms");
				stage = 9;

				/**
				 * PVP Teleports
				 */

			} else if (componentId == OPTION_3) {
				sendOptionsDialogue("PVP Areas", "Mage Bank", "Multi Area", "Wests",
						"Easts", "Revenants");
				stage = 11;

				/**
				 * Red Sandstone
				 */

			} else if (componentId == OPTION_4) {
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2589,
						2881, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_5) {
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3656,
						5113, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			}

			/**
			 * Godwars Dungeon Teleports
			 */

		} else if (stage == 7) {
			if (componentId == OPTION_1) {
				sendOptionsDialogue("Godwars Dungeon", "Nex", "Bandos",
						"Armadyl", "Saradomin", "Zamorak");
				stage = 8;

				/**
				 * The RuneSpan
				 */

			} else if (componentId == OPTION_2) { // Warriors Guild
				warriorsGuild(2871, 3542, 0);
				player.getInterfaceManager().closeChatBoxInterface();

			} else if (componentId == OPTION_3) { // Barrows
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3565,
						3289, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.sm("<col=ff0000>Remember to bring a spade with you.</col>");

			} else if (componentId == OPTION_4) { // Dominion Tower
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3366,
						3083, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Minigames", "Fight Kiln", "Fight Caves",
						"Fight Pits", "Castle Wars", "More Options");
				stage = 12;
			}

			/**
			 * Godwars Dungeon Teleports
			 */

		} else if (stage == 8) {
			if (componentId == OPTION_1) { // Nex
				teleportPlayer(2904, 5203, 0);
				player.getInterfaceManager().closeChatBoxInterface();

			} else if (componentId == OPTION_2) { // Bandos
				teleportPlayer(2849, 5349, 2);
				player.getInterfaceManager().closeChatBoxInterface();

			} else if (componentId == OPTION_3) { // Armadyl
				teleportPlayer(2855, 5271, 2);
				player.getInterfaceManager().closeChatBoxInterface();

			} else if (componentId == OPTION_4) { // Saradomin
				teleportPlayer(2893, 5300, 2);
				player.getInterfaceManager().closeChatBoxInterface();

			} else if (componentId == OPTION_5) { // Zamorak
				teleportPlayer(2923, 5349, 2);
				player.getInterfaceManager().closeChatBoxInterface();
			}

			/**
			 * Slayer Teleports
			 */

		} else if (stage == 9) {
			if (componentId == OPTION_1) { // Slayer Tower
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3429,
						3534, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_2) { // Ganodermic Beast
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 90) {
					player.getPackets()
							.sendGameMessage(
									"You need a slayer level of 90 to kill Ganodermic Beasts.");
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.getControlerManager().removeControlerWithoutCheck();
					return;
				}
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4718,
						5464, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_3) { // Glacor
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 95) {
					player.getPackets().sendGameMessage(
							"You need a slayer level of 95 to kill Glacors.");
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.getControlerManager().removeControlerWithoutCheck();
					return;
				}
				player.setNextWorldTile(new WorldTile(4180, 5720, 0));
				GlacorDungeon.EnterDungeonBoost(player);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_4) { // Jadinko
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 85) {
					player.getPackets().sendGameMessage(
							"You need a slayer level of 85 to kill Jadinkos.");
					player.getInterfaceManager().closeChatBoxInterface();
					player.getInterfaceManager().closeOverlay(true);
					player.getControlerManager().forceStop();
					player.getControlerManager().removeControlerWithoutCheck();
					return;
				}
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3013,
						9273, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			/*} else if (componentId == OPTION_5) { // Ice Strykewyrms
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 93) {
					player.getPackets().sendGameMessage(
							"You need a slayer level of 93 to kill Ice Strykewyrms.");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				return;
			}
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(
						3422, 5668, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck(); */
			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Strykewyrms", "Ice Strykewyrms",
						"Desert Styrkewyrms", "Jungle Strykewyrms", "None");
				stage = 16;
			}
			
		} else if (stage == 16) {
			if (componentId == OPTION_1) { // Ice
			if (player.getSkills().getLevelForXp(Skills.SLAYER) < 93) { //ice
				player.getPackets().sendGameMessage(
						"You need a slayer level of 93 to kill Ice Strykewyrms.");
			player.getInterfaceManager().closeChatBoxInterface();
			player.getInterfaceManager().closeOverlay(true);
			player.getControlerManager().forceStop();
			player.getControlerManager().removeControlerWithoutCheck();
			return;
		}
			Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(
					3422, 5668, 0));
			player.getInterfaceManager().closeChatBoxInterface();
			player.getInterfaceManager().closeOverlay(true);
			player.getControlerManager().forceStop();
			player.getControlerManager().removeControlerWithoutCheck();
	

			} else 	if (componentId == OPTION_2) { // Desert
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 77) {
					player.getPackets().sendGameMessage(
							"You need a slayer level of 77 to kill Desert Strykewyrms.");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				return;
			}
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(
						3364, 3157, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
		

			} else if (componentId == OPTION_3) { // Jungle
				if (player.getSkills().getLevelForXp(Skills.SLAYER) < 73) { 
					player.getPackets().sendGameMessage(
							"You need a slayer level of 73 to kill Jungle Strykewyrms.");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				return;
			}
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(
						2453, 2886, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();

			} else if (componentId == OPTION_4) { // Nothing for now
				//Magic.sendNormalTeleportSpell(player, 0, 0, CastleWars.LOBBY);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Minigames", "Clan Wars",
						"Cage Game", "Troll Invasion", "Dungeoneering", "Soul Wars");
				stage = 15;
			}

			
			/**
			 * Minigames Page 2
			 */

		} else if (stage == 12) {
			if (componentId == OPTION_1) { // Fight Kiln
				Magic.sendNormalTeleportSpell(player, 0, 0, FightKiln.OUTSIDE);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_2) { // Fight Caves
				Magic.sendNormalTeleportSpell(player, 0, 0, FightCaves.OUTSIDE);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_3) { // Fight Pits
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(4608,
						5061, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_4) { // Castle Wars
				Magic.sendNormalTeleportSpell(player, 0, 0, CastleWars.LOBBY);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_5) {
				sendOptionsDialogue("Minigames", "Clan Wars",
						"Duel Arena", "Troll Invasion", "Dungeoneering", "Soul Wars");
				stage = 15;
			}

		} else if (stage == 15) {
			if (componentId == OPTION_1) { // Clan Wars
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2993,
						9679, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_2) { //Duel Arena
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3364,
						3276, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getInterfaceManager().closeChatBoxInterface();
				
			} else if (componentId == OPTION_3) {
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2878,
						3559, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				
			
		} else if (componentId == OPTION_4) {
			Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3450,
					3728, 0));
			player.getInterfaceManager().closeChatBoxInterface();
			player.getInterfaceManager().closeOverlay(true);
			player.getControlerManager().forceStop();
			player.getControlerManager().removeControlerWithoutCheck();
			//player.getPackets().sendGameMessage("Dungeoneering is disabled(remaking dungeoneering)!");
		} else if (componentId == OPTION_5) {
			Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(1890, 3177, 0));
			player.getInterfaceManager().closeChatBoxInterface();
			player.getInterfaceManager().closeOverlay(true);
			player.getControlerManager().forceStop();
			player.getControlerManager().removeControlerWithoutCheck();
			player.getControlerManager().startControler("SoulWars");
		}
			
		} else if (stage == 21) {
			if (componentId == OPTION_1) {
				player.getPackets().sendGameMessage("Recipe for Diaster quest has been disabled.");
				//player.getControlerManager().removeControlerWithoutCheck();
				//RecipeforDisaster.enterRfd(player);
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				//player.getControlerManager().forceStop();
			}
			if (componentId == OPTION_2) {
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
			}
			if (componentId == OPTION_3) {
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
			}
			if (componentId == OPTION_4) {
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
			}
			if (componentId == OPTION_5) {
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
			}


			/**
			 * PVP
			 */

		} else if (stage == 11) {
			if (componentId == OPTION_1) { // Mage Bank
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2538,
						4715, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler("Wilderness");

			} else if (componentId == OPTION_2) { // Multi
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3240,
						3611, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler("Wilderness");

			} else if (componentId == OPTION_3) { // Wests
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(2984,
						3596, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler("Wilderness");

			} else if (componentId == OPTION_4) { // Easts
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3360,
						3658, 0));
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
				player.getControlerManager().startControler("Wilderness");

			} else if (componentId == OPTION_5) { // Revenants
				Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3078,
						10058, 0));
				player.getControlerManager().startControler("Wilderness");
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();

			} else if (componentId == OPTION_5) { // Cancel
				player.getInterfaceManager().closeChatBoxInterface();
				player.getInterfaceManager().closeOverlay(true);
				player.getControlerManager().forceStop();
				player.getControlerManager().removeControlerWithoutCheck();
			}
		}
	}

	@Override
	public void finish() {
	}

	private void teleportPlayer(int x, int y, int z) {
		player.setNextWorldTile(new WorldTile(x, y, z));
		player.stopAll();
		player.getControlerManager().startControler("GodWars");
	}

	private void warriorsGuild(int x, int y, int z) {
		player.setNextWorldTile(new WorldTile(x, y, z));
		player.stopAll();
		player.getControlerManager().startControler("WGuildControler");
	}

}
